package com.example.hotelsystem.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.hotelsystem.entity.TDict;
import com.example.hotelsystem.mapper.TDictMapper;
import com.example.hotelsystem.service.TDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Lee
 * @since 2021-03-15
 */
@Service
public class TDictServiceImpl extends ServiceImpl<TDictMapper, TDict> implements TDictService {
    @Autowired
    TDictService tDictService;

    @Override
    public String getDictText(Integer dictKey,String dictName){
        QueryWrapper<TDict> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("dict_key",dictKey);
        queryWrapper.eq("dict_name",dictName);
        TDict tDict = tDictService.getOne(queryWrapper);
        return tDict.getDictText();
    }
}
